<?php
    /**
    * Video detail video for mobile
    * 
    * @author trungdt
    * @since Oct 19, 2012
    */
    if (!defined('EXPONENT')) exit('');

    $temp=serialize($loc);
    $name = _ab_safe_html_string($_GET['id']);

    // get all new video for playlist
    $video=$db->selectObject("videomodule_video","location_data = '{$temp}' AND seo_name= '{$name}' ");
    if (!isset($video->id))
    {
        exponent_http_error(404);
    }
    else
    {
        // update views
        $video->views++;
        $db->updateObject($video,"videomodule_video");
        $video=videomodule::__VideoProcess($video);
        // get first element, for _VideoProcess return array
        $video=array_pop($video);

        // fetch to template
        $template=new template("videomodule","_Mobile_Video_Detail",$loc);
        $template->register_permissions(array('administrate',"configure", "create", "edit", "delete"),$loc);
        $template->assign("video", $video);

        $template->output();

        _ab_theme_action_register_title($video->title." - ".$cat->title);
        _ab_theme_action_register_title($video->search_des,1,0);

        _ab_theme_og_meta_set($video->search_des,0);
        _ab_theme_og_meta_set($video->title." - ".SITE_TITLE,1);
        _ab_theme_og_meta_set($video->thumbnail,2);
            
    }



?>
